import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:god_logistics/utils/tokenManage.dart';

class Settingpage extends StatefulWidget {
  const Settingpage({super.key});

  @override
  State<Settingpage> createState() => _SettingpageState();
}

class _SettingpageState extends State<Settingpage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('系统设置'), backgroundColor: Colors.purple),
      body: Container(
        width: MediaQuery.of(context).size.width,
        padding: EdgeInsets.all(20),
        color: const Color.fromARGB(255, 245, 240, 240),
        child: Column(
          children: [
            Container(
              width: MediaQuery.of(context).size.width,
              height: 400,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(10),
              ),
              child: Container(
                padding: const EdgeInsets.all(10),
                child: Column(
                  children: [
                    Expanded(
                      child: Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('换绑手机', style: TextStyle(fontSize: 20)),
                            SvgPicture.asset(
                              'assets/icons/ic_btn_more.svg',
                              width: 35,
                            ),
                          ],
                        ),
                      ),
                    ),
                    Expanded(
                      child: Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('修改密码', style: TextStyle(fontSize: 20)),
                            SvgPicture.asset(
                              'assets/icons/ic_btn_more.svg',
                              width: 35,
                            ),
                          ],
                        ),
                      ),
                    ),
                    Expanded(
                      child: Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('消息通知设置', style: TextStyle(fontSize: 20)),
                            SvgPicture.asset(
                              'assets/icons/ic_btn_more.svg',
                              width: 35,
                            ),
                          ],
                        ),
                      ),
                    ),
                    Expanded(
                      child: Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('修改密码', style: TextStyle(fontSize: 20)),
                            SvgPicture.asset(
                              'assets/icons/ic_btn_more.svg',
                              width: 35,
                            ),
                          ],
                        ),
                      ),
                    ),
                    Expanded(
                      child: Container(
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('清除缓存', style: TextStyle(fontSize: 20)),
                            SvgPicture.asset(
                              'assets/icons/ic_btn_more.svg',
                              width: 35,
                            ),
                          ],
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),

            SizedBox(height: 20),

            ElevatedButton(
              onPressed: () {
                final tokenmanger = TokenManager();
                tokenmanger.removeToken();
                Navigator.pushNamedAndRemoveUntil(
                  context,
                  '/login',
                  (route) => false,
                );
              },
              child: Container(
                width: MediaQuery.of(context).size.width - 40,
                alignment: Alignment.center,
                child: Text('退出'),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
